<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->comment('名称');
            $table->decimal('price')->comment('价格');
            $table->string('picture')->nullable()->comment('图片地址');
            $table->string('brief', 1000)->nullable()->comment('简介');
            $table->integer('sale')->comment('销售状态，0:普通，1:推荐');
            $table->string('link')->nullable()->comment('商品详情链接，如果有就优先跳转');
            $table->integer('shop_id');
            $table->integer('type_id');
            $table->integer('style_id');
            $table->integer('material_id');
            $table->integer('shape_id');
            $table->integer('group_id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
